#include "bullrt2.h"
#include"config.h"
Bullet2::Bullet2()
{
    m_Bullet2.load(BULLET2_PATH);

    m_X = GAME_WIDTH*0.5-m_Bullet2.width()*0.5;
    m_Y =GAME_HEIGHT;

    m_Free=true;

    m_Speed=BULLET2_SPEED;

     m_Rect.setWidth(m_Bullet2.width());

     m_Rect.setHeight(m_Bullet2.height());

     m_Rect.moveTo(m_X,m_Y);
}

void Bullet2::updatePosition()
{
    if(m_Free)
    {
        return;
    }
    m_Y=m_Speed+m_Y;
    m_Rect.moveTo(m_X,m_Y);
    if(m_Y<=-m_Rect.height())
    {
        m_Free=true;
    }

}
